 var editModel ="";
 var opControl ="";
 var openSource ="";

 var nextStepVisible ="";
 var editVisible="";
 var reprocessVisible="";
 var BV_END_FLOW="";

function CtrlButtonVisibled() {

if (editModel == "add")
{
	 if(document.getElementById("editbtn")!=null)//针对以前的，附件的编辑按钮在qsps_form页面里面
	 {
	     document.getElementById("editbtn").setOnaction("buttonEve('savebtn')");
	     document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_save.gif' border='0'/> 保存附件");
	     document.getElementById("editbtn").id = "savebtn";
	 }
	 if(mapFrame.document.getElementById("editbtn")!=null)//现在将对应的按钮放到qsps_form_child页面的附件布局部分里面
	 {
	     mapFrame.document.getElementById("editbtn").setOnaction("buttonEve('savebtn')");
	     mapFrame.document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_save.gif' border='0'/> 保存附件");
	     mapFrame.document.getElementById("editbtn").id = "savebtn";
	 }
	
}
else {
 //下一步按钮根据权限显示
    if (opControl.indexOf(nextStepVisible) >= 0 ){
	    if(document.getElementById("nextbtn")!=null)
	      document.getElementById("nextbtn").setVisibled(true);
    }
    else{
        if(document.getElementById("nextbtn")!=null)
      		document.getElementById("nextbtn").setVisibled(false);
    }

  if (opControl.indexOf(editVisible) >= 0 ){
  		if(document.getElementById("editbtn")!=null)//针对以前的，附件的编辑按钮在qsps_form页面里面
  		{
	        document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_edit.gif' border='0'/> 附件管理");
	        document.getElementById("editbtn").id = "editbtn";
        }
        if(mapFrame.document.getElementById("editbtn")!=null)//现在将对应的按钮放到qsps_form_child页面的附件布局部分里面
  		{
	        mapFrame.document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_edit.gif' border='0'/> 附件管理");
	        mapFrame.document.getElementById("editbtn").id = "editbtn";
        }
    }
    else{
      if (opControl.indexOf(nextStepVisible) >= 0) {
      
	       if(document.getElementById("editbtn")!=null)//针对以前的，附件的编辑按钮在qsps_form页面里面
	       {
		       document.getElementById("editbtn").setOnaction("buttonEve('savebtn')");
		       document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_save.gif' border='0'/> 保存附件");
		       document.getElementById("editbtn").id = "savebtn";
	       }
	       if(mapFrame.document.getElementById("editbtn")!=null)//现在将对应的按钮放到qsps_form_child页面的附件布局部分里面
	       {
		       mapFrame.document.getElementById("editbtn").setOnaction("buttonEve('savebtn')");
		       mapFrame.document.getElementById("editbtn").setCaption("<img align='absbottom' src='/image/kx_save.gif' border='0'/> 保存附件");
		       mapFrame.document.getElementById("editbtn").id = "savebtn";
	       }

      }else {
      	  if(document.getElementById("editbtn")!=null)//针对以前的，附件的编辑按钮在qsps_form页面里面
          	document.getElementById("editbtn").setVisibled(false);
          if(mapFrame.document.getElementById("editbtn")!=null)//现在将对应的按钮放到qsps_form_child页面的附件布局部分里面
          	{mapFrame.document.getElementById("editbtn").setVisibled(false);}
      }
    }
}
  if(opControl.indexOf(reprocessVisible)!=-1) {
  	if(document.getElementById("reprocessbtn")!=null)
      document.getElementById("reprocessbtn").setVisibled(true);
  }
  else
  {
    	if(document.getElementById("reprocessbtn")!=null)
      		document.getElementById("reprocessbtn").setVisibled(false);
	}

 if (opControl.indexOf(BV_END_FLOW) >= 0 ) {
 	 var endFlowBtn = document.getElementById("endflowbtn");
     if (endFlowBtn) {
     	endFlowBtn.setVisibled(true);
     }
 } else {
     var endFlowBtn = document.getElementById("endflowbtn");
     if (endFlowBtn) {
     	endFlowBtn.setVisibled(false);
     }
 }
}
